package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckitemDao {

    @Insert("insert into t_checkitem(code, name, sex, age, price, type, attention, remark) values " +
            "(#{code},#{name},#{sex},#{age},#{price},#{type},#{attention},#{remark})")
    void insert(CheckItem checkItem);

    Page<CheckItem> pageQuery(String queryString);

    @Delete("delete from t_checkitem where id = #{id}")
    void deleteById(Integer id);

    @Select("select * from t_checkitem where id = #{id}")
    CheckItem findById(Integer id);

    void update(CheckItem checkItem);

    @Select("select * from t_checkitem")
    List<CheckItem> findAll();
}
